package spitfire.ksim.data;

import java.util.ArrayList;
import java.util.List;

public class TSDRequestData {
	
	public class RequestEntry {
		public String sensorType;
		public KSensorSnapshot sensorSnapshot;
		
		public RequestEntry(String sensorType, KSensorSnapshot snapshot) {
			this.sensorType = sensorType;
			this.sensorSnapshot = snapshot;
		}
		@Override
		public String toString() {
			StringBuilder builder = new StringBuilder();
			builder.append("[");
			builder.append(sensorType);
			builder.append(", ");
			builder.append(sensorSnapshot);
			builder.append("]");
			return builder.toString();
		}
	}
	private String nodeId;
	private List<RequestEntry> requestEntryList = new ArrayList<RequestEntry>();

	public TSDRequestData(String nodeId) {
		this.nodeId = nodeId;
	}
	
	public void addSensorSnapshot(String sensorType, KSensorSnapshot snapshot) {
		requestEntryList.add(new RequestEntry(sensorType, snapshot));
	}
	
	public List<RequestEntry> getData() {
		return requestEntryList;
	}
	
	public String getNodeId() {
		return nodeId;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("TSDRequestData [nodeId=");
		builder.append(nodeId);
		builder.append(", sensorSnapshotList=");
		builder.append(requestEntryList);
		builder.append("]");
		return builder.toString();
	}
}
